// 公共的axios
import axios from 'axios'

const shopapi = axios.create({
    baseURL: 'http://192.168.11.250:6255',
    timeout:5000,
})

// request interceptor
shopapi.interceptors.request.use(
    config => {
    if (!config.headers['X-Litemall-Token']) {
        config.headers['X-Litemall-Token'] = `${window.localStorage.getItem(
        'token'
        ) || ''}`;
    }
    return config;
    },
    err => Promise.reject(err)
)

export default shopapi